﻿using System;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;

namespace Negocio
{
     public class Appointment: PersistentObject
    {
        private DateTime date;        
        private ObservableCollection<Player> players;

        public Appointment()
        {
            this.Date = new DateTime();
            this.Players = new ObservableCollection<Player>();
        }

        public DateTime Date 
        {
            get { return this.date;}
            set { this.date = value;}
        }        

        public ObservableCollection<Player> Players 
        {
            get { return this.players;}
            set { this.players = value; }
        }

        public bool addPlayer(Player onePlayer)
        { 
            bool ret = false;
            if(!this.Players.Contains(onePlayer))
            {
                this.Players.Add(onePlayer);
                ret = true;
            }
            return ret;
        }

        public void deletePlayer(Player onePlayer)
        {
            this.Players.Remove(onePlayer);
        }

        
    }
}
